package com.indexingsystem.boss.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * dh_orders
 * 
 * @author
 */
public class Orders implements Serializable {

	/**
	 * 
	 */
	private static final long	serialVersionUID	= -7774371693575450526L;

	private String				orderId;

	/**
	 * 用户Id
	 */
	private String				userId;

	/**
	 * 当前机构id
	 */
	private String				cgsInstitutionId;

	/**
	 * 上级构id
	 */
	private String				institutionId;

	/**
	 * 商品总价
	 */
	private BigDecimal			productsPrice;

	/**
	 * 运费
	 */
	private BigDecimal			freightPrice;

	/**
	 * 订单总价
	 */
	private BigDecimal			totalPrice;

	/**
	 * 下单时间
	 */
	private Date				createDate;

	/**
	 * 创建订单起时间，每个订单默认资源分类时间为下单时间+1年，资源分类中的年份需要过滤last_date为结束时间的资源分类中的资源，只有续约后，
	 * last_date更新时间为+1年；
	 */
	private Date				endDate;

	/**
	 * 支付类型;（1虚拟币/2现金/3支付宝）
	 */
	private Integer				payType;

	/**
	 * 支付状态(0 未支付 1 已支付)
	 */
	private Integer				payStatus;

	/**
	 * 支付标识;(由支付方式而定，比如支付宝为支付宝交易号)
	 */
	private String				payIdentifier;

	/**
	 * 支付时间
	 */
	private Date				payDate;

	/**
	 * 取消时间
	 */
	private Date				cancelDate;

	/**
	 * 取消原因
	 */
	private String				cancelReason;

	/**
	 * 取消类型;（1用户取消/2管理员取消//3系统取消）
	 */
	private Integer				cancelType;

	/**
	 * 订单状态;（ 待安装：-0 安装中:-1 已完成(已安装)-2 已取消-3 已到期关闭-4 ）
	 */
	private Integer				state;

	/**
	 * 同步状态（云中馆） （待同步：0 同步成功1 同步失败-2 已删除-3）
	 */
	private Integer				syncState;

	/**
	 * 订单复制copy次数上限
	 */
	private Integer				copyCount;

	private String				remark;

	/**
	 * 常用联系人Id
	 */
	private String				consigneeMessageId;

	/**
	 * 发货方式;（快递1/绑定2）
	 */
	private Integer				deliverType;

	private Date				deliverDate;

	/**
	 * 订单类型;（ 1 五报十一刊 2 其它类型）
	 */
	private Integer				orderType;

	private String				installUserId;

	private String				pushUserId;

	/**
	 * 订单分类 0 镜像馆 1 云中馆
	 */
	private Integer				orderCategory;

	/**
	 * 升级状态（对镜像馆） 0 未升级 1 已升级
	 */
	private Integer				upgradeStatus;

	public String getOrderId() {
		return orderId;
	}

	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getCgsInstitutionId() {
		return cgsInstitutionId;
	}

	public void setCgsInstitutionId(String cgsInstitutionId) {
		this.cgsInstitutionId = cgsInstitutionId;
	}

	public String getInstitutionId() {
		return institutionId;
	}

	public void setInstitutionId(String institutionId) {
		this.institutionId = institutionId;
	}

	public BigDecimal getProductsPrice() {
		return productsPrice;
	}

	public void setProductsPrice(BigDecimal productsPrice) {
		this.productsPrice = productsPrice;
	}

	public BigDecimal getFreightPrice() {
		return freightPrice;
	}

	public void setFreightPrice(BigDecimal freightPrice) {
		this.freightPrice = freightPrice;
	}

	public BigDecimal getTotalPrice() {
		return totalPrice;
	}

	public void setTotalPrice(BigDecimal totalPrice) {
		this.totalPrice = totalPrice;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public Integer getPayType() {
		return payType;
	}

	public void setPayType(Integer payType) {
		this.payType = payType;
	}

	public Integer getPayStatus() {
		return payStatus;
	}

	public void setPayStatus(Integer payStatus) {
		this.payStatus = payStatus;
	}

	public String getPayIdentifier() {
		return payIdentifier;
	}

	public void setPayIdentifier(String payIdentifier) {
		this.payIdentifier = payIdentifier;
	}

	public Date getPayDate() {
		return payDate;
	}

	public void setPayDate(Date payDate) {
		this.payDate = payDate;
	}

	public Date getCancelDate() {
		return cancelDate;
	}

	public void setCancelDate(Date cancelDate) {
		this.cancelDate = cancelDate;
	}

	public String getCancelReason() {
		return cancelReason;
	}

	public void setCancelReason(String cancelReason) {
		this.cancelReason = cancelReason;
	}

	public Integer getCancelType() {
		return cancelType;
	}

	public void setCancelType(Integer cancelType) {
		this.cancelType = cancelType;
	}

	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public Integer getSyncState() {
		return syncState;
	}

	public void setSyncState(Integer syncState) {
		this.syncState = syncState;
	}

	public Integer getCopyCount() {
		return copyCount;
	}

	public void setCopyCount(Integer copyCount) {
		this.copyCount = copyCount;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getConsigneeMessageId() {
		return consigneeMessageId;
	}

	public void setConsigneeMessageId(String consigneeMessageId) {
		this.consigneeMessageId = consigneeMessageId;
	}

	public Integer getDeliverType() {
		return deliverType;
	}

	public void setDeliverType(Integer deliverType) {
		this.deliverType = deliverType;
	}

	public Date getDeliverDate() {
		return deliverDate;
	}

	public void setDeliverDate(Date deliverDate) {
		this.deliverDate = deliverDate;
	}

	public Integer getOrderType() {
		return orderType;
	}

	public void setOrderType(Integer orderType) {
		this.orderType = orderType;
	}

	public String getInstallUserId() {
		return installUserId;
	}

	public void setInstallUserId(String installUserId) {
		this.installUserId = installUserId;
	}

	public String getPushUserId() {
		return pushUserId;
	}

	public void setPushUserId(String pushUserId) {
		this.pushUserId = pushUserId;
	}

	public Integer getOrderCategory() {
		return orderCategory;
	}

	public void setOrderCategory(Integer orderCategory) {
		this.orderCategory = orderCategory;
	}

	public Integer getUpgradeStatus() {
		return upgradeStatus;
	}

	public void setUpgradeStatus(Integer upgradeStatus) {
		this.upgradeStatus = upgradeStatus;
	}

	@Override
	public boolean equals(Object that) {
		if (this == that) {
			return true;
		}
		if (that == null) {
			return false;
		}
		if (getClass() != that.getClass()) {
			return false;
		}
		Orders other = (Orders) that;
		return (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals( other.getOrderId() ))
				&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals( other.getUserId() ))
				&& (this.getCgsInstitutionId() == null ? other.getCgsInstitutionId() == null : this.getCgsInstitutionId().equals(
						other.getCgsInstitutionId() ))
				&& (this.getInstitutionId() == null ? other.getInstitutionId() == null : this.getInstitutionId().equals( other.getInstitutionId() ))
				&& (this.getProductsPrice() == null ? other.getProductsPrice() == null : this.getProductsPrice().equals( other.getProductsPrice() ))
				&& (this.getFreightPrice() == null ? other.getFreightPrice() == null : this.getFreightPrice().equals( other.getFreightPrice() ))
				&& (this.getTotalPrice() == null ? other.getTotalPrice() == null : this.getTotalPrice().equals( other.getTotalPrice() ))
				&& (this.getCreateDate() == null ? other.getCreateDate() == null : this.getCreateDate().equals( other.getCreateDate() ))
				&& (this.getEndDate() == null ? other.getEndDate() == null : this.getEndDate().equals( other.getEndDate() ))
				&& (this.getPayType() == null ? other.getPayType() == null : this.getPayType().equals( other.getPayType() ))
				&& (this.getPayStatus() == null ? other.getPayStatus() == null : this.getPayStatus().equals( other.getPayStatus() ))
				&& (this.getPayIdentifier() == null ? other.getPayIdentifier() == null : this.getPayIdentifier().equals( other.getPayIdentifier() ))
				&& (this.getPayDate() == null ? other.getPayDate() == null : this.getPayDate().equals( other.getPayDate() ))
				&& (this.getCancelDate() == null ? other.getCancelDate() == null : this.getCancelDate().equals( other.getCancelDate() ))
				&& (this.getCancelReason() == null ? other.getCancelReason() == null : this.getCancelReason().equals( other.getCancelReason() ))
				&& (this.getCancelType() == null ? other.getCancelType() == null : this.getCancelType().equals( other.getCancelType() ))
				&& (this.getState() == null ? other.getState() == null : this.getState().equals( other.getState() ))
				&& (this.getSyncState() == null ? other.getSyncState() == null : this.getSyncState().equals( other.getSyncState() ))
				&& (this.getCopyCount() == null ? other.getCopyCount() == null : this.getCopyCount().equals( other.getCopyCount() ))
				&& (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals( other.getRemark() ))
				&& (this.getConsigneeMessageId() == null ? other.getConsigneeMessageId() == null : this.getConsigneeMessageId().equals(
						other.getConsigneeMessageId() ))
				&& (this.getDeliverType() == null ? other.getDeliverType() == null : this.getDeliverType().equals( other.getDeliverType() ))
				&& (this.getDeliverDate() == null ? other.getDeliverDate() == null : this.getDeliverDate().equals( other.getDeliverDate() ))
				&& (this.getOrderType() == null ? other.getOrderType() == null : this.getOrderType().equals( other.getOrderType() ))
				&& (this.getInstallUserId() == null ? other.getInstallUserId() == null : this.getInstallUserId().equals( other.getInstallUserId() ))
				&& (this.getPushUserId() == null ? other.getPushUserId() == null : this.getPushUserId().equals( other.getPushUserId() ))
				&& (this.getOrderCategory() == null ? other.getOrderCategory() == null : this.getOrderCategory().equals( other.getOrderCategory() ))
				&& (this.getUpgradeStatus() == null ? other.getUpgradeStatus() == null : this.getUpgradeStatus().equals( other.getUpgradeStatus() ));
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
		result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
		result = prime * result + ((getCgsInstitutionId() == null) ? 0 : getCgsInstitutionId().hashCode());
		result = prime * result + ((getInstitutionId() == null) ? 0 : getInstitutionId().hashCode());
		result = prime * result + ((getProductsPrice() == null) ? 0 : getProductsPrice().hashCode());
		result = prime * result + ((getFreightPrice() == null) ? 0 : getFreightPrice().hashCode());
		result = prime * result + ((getTotalPrice() == null) ? 0 : getTotalPrice().hashCode());
		result = prime * result + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode());
		result = prime * result + ((getEndDate() == null) ? 0 : getEndDate().hashCode());
		result = prime * result + ((getPayType() == null) ? 0 : getPayType().hashCode());
		result = prime * result + ((getPayStatus() == null) ? 0 : getPayStatus().hashCode());
		result = prime * result + ((getPayIdentifier() == null) ? 0 : getPayIdentifier().hashCode());
		result = prime * result + ((getPayDate() == null) ? 0 : getPayDate().hashCode());
		result = prime * result + ((getCancelDate() == null) ? 0 : getCancelDate().hashCode());
		result = prime * result + ((getCancelReason() == null) ? 0 : getCancelReason().hashCode());
		result = prime * result + ((getCancelType() == null) ? 0 : getCancelType().hashCode());
		result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
		result = prime * result + ((getSyncState() == null) ? 0 : getSyncState().hashCode());
		result = prime * result + ((getCopyCount() == null) ? 0 : getCopyCount().hashCode());
		result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
		result = prime * result + ((getConsigneeMessageId() == null) ? 0 : getConsigneeMessageId().hashCode());
		result = prime * result + ((getDeliverType() == null) ? 0 : getDeliverType().hashCode());
		result = prime * result + ((getDeliverDate() == null) ? 0 : getDeliverDate().hashCode());
		result = prime * result + ((getOrderType() == null) ? 0 : getOrderType().hashCode());
		result = prime * result + ((getInstallUserId() == null) ? 0 : getInstallUserId().hashCode());
		result = prime * result + ((getPushUserId() == null) ? 0 : getPushUserId().hashCode());
		result = prime * result + ((getOrderCategory() == null) ? 0 : getOrderCategory().hashCode());
		result = prime * result + ((getUpgradeStatus() == null) ? 0 : getUpgradeStatus().hashCode());
		return result;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append( getClass().getSimpleName() );
		sb.append( " [" );
		sb.append( "Hash = " ).append( hashCode() );
		sb.append( ", orderId=" ).append( orderId );
		sb.append( ", userId=" ).append( userId );
		sb.append( ", cgsInstitutionId=" ).append( cgsInstitutionId );
		sb.append( ", institutionId=" ).append( institutionId );
		sb.append( ", productsPrice=" ).append( productsPrice );
		sb.append( ", freightPrice=" ).append( freightPrice );
		sb.append( ", totalPrice=" ).append( totalPrice );
		sb.append( ", createDate=" ).append( createDate );
		sb.append( ", endDate=" ).append( endDate );
		sb.append( ", payType=" ).append( payType );
		sb.append( ", payStatus=" ).append( payStatus );
		sb.append( ", payIdentifier=" ).append( payIdentifier );
		sb.append( ", payDate=" ).append( payDate );
		sb.append( ", cancelDate=" ).append( cancelDate );
		sb.append( ", cancelReason=" ).append( cancelReason );
		sb.append( ", cancelType=" ).append( cancelType );
		sb.append( ", state=" ).append( state );
		sb.append( ", syncState=" ).append( syncState );
		sb.append( ", copyCount=" ).append( copyCount );
		sb.append( ", remark=" ).append( remark );
		sb.append( ", consigneeMessageId=" ).append( consigneeMessageId );
		sb.append( ", deliverType=" ).append( deliverType );
		sb.append( ", deliverDate=" ).append( deliverDate );
		sb.append( ", orderType=" ).append( orderType );
		sb.append( ", installUserId=" ).append( installUserId );
		sb.append( ", pushUserId=" ).append( pushUserId );
		sb.append( ", orderCategory=" ).append( orderCategory );
		sb.append( ", upgradeStatus=" ).append( upgradeStatus );
		sb.append( ", serialVersionUID=" ).append( serialVersionUID );
		sb.append( "]" );
		return sb.toString();
	}
}